#include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

bool compareIsbn(
    string &s1) //好像这里不能加const,报错：对象包含与成员函数不兼容的类型限定符
{
  if (s1.size() > 5) {
    return true;
  } else {
    return false;
  }
}
int main(int argc, char **argv) {
  string a[10] = {"diuwudh", "udh",  "diudh",       "wudh", "diuwu",
                  "h",       "diuw", "diuwudhg257", "h",    "d"};
  vector<string> vec1(a, a + 10); //利用数组初始化vector
  vector<string>::iterator it1 = vec1.begin();
  vector<string>::iterator it2;
  it2 = partition(vec1.begin(), vec1.end(), compareIsbn); //排序
  cout << "排序后的vector中大于5的元素:";
  for (; it1 != it2; ++it1) {
    cout << *it1 << " ";
  }

  return 0;
}